import 'package:basic_common/app_theme.dart';
import 'package:basic_common/common_exports.dart';
import 'package:basic_services/model/server_other_detail_data.dart';
import 'package:basic_services/serviceDetail/service_detail_controller.dart';
import 'package:basic_widgets/image_widget.dart';
import 'package:basic_widgets/text_widget.dart';

class OtherInfoView extends GetView<ServerDetailController> {
  ServerOtherDetailData? detailData;
  SriList? srLiiData;

  OtherInfoView({required this.detailData});
  @override
  Widget build(BuildContext context) {
    if (detailData!.sriList != null) {
      List<SriList> list = detailData!.sriList!;

      if (list.isNotEmpty) {
        srLiiData = list[0];
      }
    }

    return detailData!.sriList != null && detailData != null
        ? Container(
            width: ScreenHelper.screenWidth,
            alignment: Alignment.center,
            padding: EdgeInsets.symmetric(horizontal: ScreenHelper.width(15)),
            margin: EdgeInsets.symmetric(
                horizontal: ScreenHelper.width(15),
                vertical: ScreenHelper.height(10)),
            color: Colors.white,
            child: Column(
              children: [
                Container(
                  margin: EdgeInsets.symmetric(vertical: 6),
                  child: textItemWidget(
                      attrName: '测量说明',
                      value: '${srLiiData!.result}',
                      fontSize: 16,
                      valuColor: AppTheme.dartTextColor),
                ),
                Container(
                  margin: EdgeInsets.symmetric(vertical: 6),
                  child: textItemWidget(
                      attrName: '评估',
                      value: '${srLiiData!.evaluate}',
                      fontSize: 16,
                      valuColor: AppTheme.dartTextColor),
                ),
                circleImg(head: srLiiData!.resultImg!, width: 120, raduis: 0)
              ],
            ))
        : SizedBox.shrink();
  }
}
